package com.lkd.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lkd.entity.Order;
import com.lkd.mapper.OrderMapper;
import com.lkd.service.OrderService;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 聂德祥
 * @since 2024-08-20
 */
@Service
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {

    @Override
    public Integer getOrderByTime(LocalDateTime start, LocalDateTime end) {
        return baseMapper.getOrderByTime(start,end);
    }

    @Override
    public Integer getOrderAmount(LocalDateTime start, LocalDateTime end) {
        Integer orderAmount = baseMapper.getOrderAmount(start, end);
        if(orderAmount==null){
            return 0;
        }
        return orderAmount;
    }
}
